//
//  MerryViewController.m
//  Wedding
//
//  Created by Lovetong on 15/3/17.
//  Copyright (c) 2015年 mac. All rights reserved.
//

#import "MerryViewController.h"
#import "ScrollView.h"

@interface MerryViewController ()

@property (nonatomic, retain) NSMutableArray *scrollViewImageUrlArray;
@property (nonatomic, retain) NSMutableArray *tableViewArray;
@property (nonatomic, retain) UITableView *tableView;

@end

@implementation MerryViewController

- (void)awakeFromNib
{
    [super awakeFromNib];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.navigationController.navigationBar setTranslucent:NO];
    [self createTableView];
}

- (NSMutableArray *)scrollViewImageUrlArray
{
    if (!_scrollViewImageUrlArray) {
        _scrollViewImageUrlArray = [NSMutableArray arrayWithCapacity:0];
    }
    return _scrollViewImageUrlArray;
}

- (NSMutableArray *)tableViewArray
{
    if (!_tableViewArray) {
        _tableViewArray = [NSMutableArray arrayWithCapacity:0];
    }
    return _tableViewArray;
}

- (void)createScrollView
{
    ScrollView *scrollView = [[ScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 200) timerAnimationTime:4.0f pageControl:YES];
    [scrollView setScrollViewWithImageArray:_scrollViewImageUrlArray imageUrlKey:@"image_path"];
    [self.tableView setTableHeaderView:scrollView];
    [scrollView release];
}

- (void)createTableView
{
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 64) style:UITableViewStylePlain];
    [_tableView setBackgroundColor:[UIColor redColor]];
    [_tableView setSeparatorColor:[UIColor clearColor]];
    [self.view addSubview:_tableView];
    [_tableView release];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)dealloc
{
    [_tableViewArray release];
    [_scrollViewImageUrlArray release];
    [_tableView release];
    [super dealloc];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
